#include <iostream>
#include <iomanip>

using namespace std;

template <typename T>
T factorial(T n)
{
    if (n < 2)
        return 1;
    else
        return n * factorial(n - 1);
}

int main()
{
    for (size_t i = 1; i <= 5; ++i)
        cout << setiosflags(ios::fixed) << setw(4)
                << i << "!=" << factorial(i);
    cout << endl;
    for (long i = 6; i <= 10; ++i)
        cout << setiosflags(ios::fixed) << setw(4)
                << i << "!=" << factorial(i);
    return 0;
}